#-*- coding: utf-8 -*-
from django.shortcuts import render, render_to_response
from django.contrib.auth import logout 
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.decorators import login_required
from django.template import RequestContext, loader
from shoplist.views import *
from BPCreator.views import *

# Create your views here.
# def index(request):
#     return render_to_response(request, 'index.html')

def index(request):
#     template = loader.get_template('index.html')
#     context = RequestContext(request, { 'index' : index,
#     })
#     return HttpResponse(template.render(context))
#     return render_to_response(request, 'index')
    return render(request, 'index.html')

@login_required
def scm_home(request):
    #portail de l'appication
    return render(request, 'home.html')

def boot(request):
    return render_to_response('exemple.html',{},context_instance=RequestContext(request))

def logout_page(request):
    """
    Log users out and re-direct them to the main page.
    """
    logout(request)
    return HttpResponseRedirect('/')